package com.max.xihu.patterns.single;

/**
 * @Author: Max
 * @Date: 2020-08-25 23:21
 * @Description:双重检查锁
 */
public class SingletonDL {

    private static SingletonDL instance;

    private SingletonDL(){}//私有构造方法

    //公共全局访问点
    public static SingletonDL getInstance(){
        if (instance == null){
            synchronized (SingletonDL.class){
                if (instance == null){
                    instance = new SingletonDL();
                }
            }
        }
        return instance;
    }
}
